package org.spider.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author lzy
 * @since 2022-06-02 15:36:46
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("spider_config_task")
@ApiModel(value = "SpiderConfigTaskEntity对象", description = "")
public class SpiderConfigTaskEntity extends Model<SpiderConfigTaskEntity> {

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty("任务名称")
    @TableField("task_name")
    private String taskName;

    @ApiModelProperty("任务kafka-topic名称")
    @TableField("task_topic")
    private String taskTopic;

    @ApiModelProperty("任务kafka-topic分区数")
    @TableField("task_topic_partition")
    private Integer taskTopicPartition;

    @ApiModelProperty("任务日志kafka-topic名称")
    @TableField("task_log_topic")
    private String taskLogTopic;

    @ApiModelProperty("任务日志kafka-topic分区数")
    @TableField("task_log_topic_partition")
    private Integer taskLogTopicPartition;

    @ApiModelProperty("任务最大重试次数")
    @TableField("task_max_retry")
    private Integer taskMaxRetry;

    @ApiModelProperty("任务队列名称")
    @TableField("task_queue")
    private String taskQueue;

    @ApiModelProperty("任务队列最大数量")
    @TableField("task_queue_max")
    private Integer taskQueueMax;

    @ApiModelProperty("采集周期，单位：秒")
    @TableField("task_crawler_period")
    private Integer taskCrawlerPeriod;

    @ApiModelProperty("任务超时，单位：秒")
    @TableField("task_timeout")
    private Integer taskTimeout;

    @ApiModelProperty("任务缓存名称")
    @TableField("task_cache")
    private String taskCache;

    @ApiModelProperty("任务缓存最大数量")
    @TableField("task_cache_max")
    private Integer taskCacheMax;

    @ApiModelProperty("任务模板")
    @TableField("task_template")
    private String taskTemplate;

    @ApiModelProperty("任务状态，1：未启用；2：正在运行；3：运行结束；4：堵塞")
    @TableField("task_status")
    private Integer taskStatus;

    @ApiModelProperty("任务数量")
    @TableField("task_count")
    private Integer taskCount;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
